package com.bitoon.basketdudes.jpa;

import java.io.Serializable;
import javax.persistence.Entity;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Id;

/**
 * @author paco FELC 2012
 *
 * Bolsa de puntos para conversión de una moneda virtual a bitoones.
 */
@Entity
@Table(name = "bolsa", schema = "central")
@NamedQueries({
    @NamedQuery(name = "Bolsa.findAll", query = "SELECT c FROM Bolsa c"),
    @NamedQuery(name = "Bolsa.findById", query = "SELECT c FROM Bolsa c WHERE c.id = :id")
})

public class Bolsa implements Serializable {
    private static final Integer serialVersionUID = 1;
    @Id
    private Integer id;
    private int     precio;
    private int     bitoones;

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getPrecio() {
        return precio;
    }

    public void setPrecio(Integer valor) {
        this.precio = valor;
    }

    public Integer getBitoones() {
        return bitoones;
    }

    public void setBitoones(Integer valor) {
        this.bitoones = valor;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Bolsa)) {
            return false;
        }
        Bolsa other = (Bolsa) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.bitoon.basketdudes.jpa.Bolsa[id=" + id + "]";
    }

}

